
package com.bluelinelabs.conductor.conductor;

import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.IntentParams;
import ohos.agp.components.ComponentContainer;

import com.bluelinelabs.conductor.conductor.internal.LifecycleHandler;

import static com.bluelinelabs.conductor.conductor.internal.ThreadUtils.ensureMainThread;

/**
 * lipeiquan
 *
 * @since 2021-05-06
 */
public class Conductor {


    public static Router attachRouter(AbilitySlice activity, ComponentContainer container, IntentParams savedInstanceState) {
        ensureMainThread();
        Router router = LifecycleHandler.install(activity, container)
            .getRouter(container, savedInstanceState);
        router.rebindIfNeeded();
        return router;
    }


}
